package com.zhongmeng.rxjava2test.adapter

import android.content.Context

import com.zhongmeng.rxjava2test.R
import com.zhongmeng.rxjava2test.bean.Work
import com.zhy.adapter.recyclerview.CommonAdapter
import com.zhy.adapter.recyclerview.base.ViewHolder

/**
 * author :rcw.
 * date :2017/10/12 14:53.
 */

class WorkNoticeAdapter(context: Context, layoutId: Int, //private String platType;
                        datas: List<Work.TjdbListBean>)//platType= SaveUserInfo.getInstance().getType();
    : CommonAdapter<Work.TjdbListBean>(context, layoutId, datas) {

    protected override fun convert(holder: ViewHolder, o: Work.TjdbListBean, position: Int) {
        when (position) {
            0 -> holder.setText(R.id.title, datas[position].typeName + "(" + datas[position].neednumber + ")")
            1 -> holder.setText(R.id.title, datas[position].typeName + "(" + datas[position].currentnumber + ")")
        }


        /*LinearLayout linearLayout=holder.getView(R.id.item);
        linearLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                LogUtils.z("URL="+datas.get(position).getUrl()+"posion="+position);
            }
        });*/
    }

}
